<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
		
		<link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.min.css" />
		<link rel="stylesheet" type="text/css" href="css/custom.css" />
		<script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
	    <script type="text/javascript" src="bootstrap/js/bootstrap.min.js"></script>
	    <script type="text/javascript" src="js/custom.js"></script>
	    
		<title>Insert title here</title>
	</head>
	
	<body>
		<!-- Menu -->
		<div class="navbar">
			<div class="navbar-inner">
				<div class="container">
					<a class="brand" href="index.jsp">Estat&iacute;stica</a>
<!-- 					<ul class="nav"> -->
<!-- 						<li><a href="index.jsp">Tabela</a></li> -->
<!-- 						<li><a href="#">Popula&ccedil;&atilde;o</a></li> -->
<!-- 						<li><a href="#">Amostra</a></li> -->
<!-- 					</ul> -->
				</div>
			</div>
		</div>
	
	
	
		<!-- Conteudo -->
		<div class="container">
			<div class="page-header">
				<h1>Estat&iacute;stica Descritiva</h1>
			</div>
			
			<div class="span7 margin-none">
				<div class="span12 margin-none">
					<form action="EstatisticaControle" method="post" name="formDados">
<!-- 						<textarea class="span6" rows="5" cols="30" name="valores">150 151 152 153 154 154 154 155 155 154 155 155 157 158 158 159 159 160 161 161 158 158 159 161 162 163 163 165 162 163 163 165 166 166 167 168 168 170 171 173</textarea><br/> -->
						<textarea class="span6" rows="5" cols="30" name="valores"></textarea><br/>
						<input id="btn-gerar" class="btn btn-info" type="submit" value="Gerar"/>
					</form>
				</div>
			
<%-- 			R = <c:out value="${r}"/><br/> --%>
<%-- 			K = <c:out value="${k}"/><br/> --%>
<%-- 			H = <c:out value="${h}"/><br/> --%>

				<div class="page-header">
					<h1><small>Tabela de Distribui&ccedil;&atilde;o de Frequ&ecirc;ncias</small></h1>
				</div>
				
				<div class="span12 margin-none">
					<div id="tabela" class="span6 margin-none">
						<table>
							<thead>
								<tr>
									<th>N</th>
									<th>Dados</th>
									<th>Fi</th>
									<th>Xi</th>
									<th>Fac</th>
									<th>Fi(%)</th>
									<th>FacR(%)</th>
								</tr>
							</thead>
							<tbody>
								<c:forEach begin="1" end="${k}" var="k">
									<tr>
										<td>${k}</td>
										<td>${menorValor} |- ${menorValor+h}</td>
										<td>${vetFi[k-1]}</td>
										<td>${vetXi[k-1]}</td>
										<td>${vetFac[k-1]}</td>
										<td>${vetFiPerc[k-1]}</td>
										<td>${vetFacR[k-1]}</td>
									</tr>
									<c:set var="menorValor" value="${menorValor + h}"></c:set>
								</c:forEach>
							</tbody>
							<tfoot>
								<tr>
									<td></td>
									<td>Total</td>
									<td>${numValores}</td>
									<td>-</td>
									<td>-</td>
									<td>100,0</td>
									<td>-</td>
								</tr>
							</tfoot>
						</table>
					</div>
				</div>
			</div>
			
			<div class="span5">
				<div class="page-header">
					<h1><small>Dados Amostrais</small></h1>
				</div>
				M&eacute;dia = <c:out value="${mediaAmostra}"/><br/>
				M&eacute;dia Geom&eacute;trica = <c:out value="${mediaGeoAmostra}"/><br/>
				Desvio Padr&atilde;o = <c:out value="${desvioPAmostra}"/><br/>
				Vari&acirc;ncia = <c:out value="${varianciaAmostra}"/><br/>
				Coef. Varia&ccedil;&atilde;o = <c:out value="${coefAmostra}%"/><br/>
			</div>
			
			<div class="span5">
				<div class="page-header">
					<h1><small>Dados Populacionais</small></h1>
				</div>
				M&eacute;dia = <c:out value="${media}"/><br/>
				M&eacute;dia Geom&eacute;trica = <c:out value="${mediaGeom}"/><br/>
				Mediana = <c:out value="${mediana}"/><br/>
				Moda = <c:out value="${moda}"/><br/>
				Desvio Padr&atilde;o = <c:out value="${desvioPPopul}"/><br/>
				Vari&acirc;ncia = <c:out value="${varianciaPopul}"/><br/>
				Coef. Varia&ccedil;&atilde;o = <c:out value="${coefPopul}%"/><br/>
			</div>
			
	<!-- 		<p>Dados Amostra</p> -->
	<%-- 		Media = <c:out value="${media}"/><br/> --%>
	<%-- 		Media Geometrica = <c:out value="${mediaGeom}"/><br/> --%>
	<%-- 		Mediana = <c:out value="${mediana}"/><br/> --%>
	<%-- 		Moda = <c:out value="${moda}"/><br/> --%>
	<%-- 		Desvio Padrao = <c:out value="${desvPadrao}"/><br/> --%>
	<%-- 		Variancia = <c:out value="${variancia}"/><br/> --%>
	<%-- 		Coef. Variacao = <c:out value="${coefVariacao}"/><br/> --%>

		</div>
	</body>
	<script>
		$(document).ready(function(){
			
			$("#btn-gerar").click(function(){
				$("#tabela").fadeIn;
			});
		});
	</script>
</html>